package com.xmy.cultivate.service.impl;

import com.xmy.cultivate.entity.GradeLayer;
import com.xmy.cultivate.mapper.GradeLayerMapper;
import com.xmy.cultivate.service.IGradeLayerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 班级分层设置 服务实现类
 * </p>
 *
 * @author hpiggy
 * @since 2024-08-26
 */
@Service
public class GradeLayerServiceImpl extends ServiceImpl<GradeLayerMapper, GradeLayer> implements IGradeLayerService {

    @Autowired
    GradeLayerMapper gradeLayerMapper;

    /**
     * 是否在分数设置里
     * @param yearPart
     * @param quarterNum
     * @param subjectsId
     * @param yearClassId
     * @param classTypeId
     * @param lessonType
     * @param startScore
     * @param endScore
     * @return
     */
    @Override
    public Integer getLayerCount(Integer yearPart,
                                 Integer quarterNum,
                                 Long subjectsId,
                                 Integer yearClassId,
                                 Long classTypeId,
                                 Integer lessonType,
                                 BigDecimal startScore,
                                 BigDecimal endScore){
        return gradeLayerMapper.getLayerCount(yearPart,quarterNum,subjectsId,yearClassId,classTypeId,lessonType,startScore,endScore);
    }

    @Override
    public List<GradeLayer> getLayerList(Integer yearPart,
                                         Integer quarterNum,
                                         Long subjectsId,
                                         Integer yearClassId,
                                         Long classTypeId,
                                         Integer lessonType){
        return gradeLayerMapper.getLayerList(yearPart,quarterNum,subjectsId,yearClassId,classTypeId,lessonType);
    }

    @Override
    public GradeLayer getLayer(Integer yearPart, Integer quarterNum, Long subjectsId, Integer yearClassId, Long classTypeId, Integer lessonType) {
        return gradeLayerMapper.getLayer(yearPart,quarterNum,subjectsId,yearClassId,classTypeId,lessonType);
    }
}
